package com.example.demo.controller;

import com.example.demo.generator.CodeGeneratorAter;
import com.example.demo.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/*
 * @Author:大力王
 * @Date:2024/3/17-17-2:56
 * 开始了
 */
@Api(tags = "前端不要动！！")
@RestController
@RequestMapping("/generator")
public class GeneratorController {
    @Autowired
    private CodeGeneratorAter codeGeneratorAter;

    @ApiOperation(value = "生成代码接口")
    @PostMapping("/generateCode")
    public Result generateCode(@RequestParam String tableName,@RequestParam boolean noController){
        codeGeneratorAter.generator(tableName,noController);
        return Result.success().msg("代码生成成功");
    }

}
